import axios from "axios";

axios.defaults.baseURL = "/api"

const request = axios.create({
    timeout:5000
})

//请求拦截
request.interceptors.request.use(config=>{
    config.headers.token = localStorage.getItem("token")?localStorage.getItem("token"):null;
    return config;
    },error =>{
        Promise.reject(err);
    }
)

export default request